import { CSSProperties } from 'vue'
import { TabsProps, TabPaneProps } from 'element-plus'
import { IconifyJSON } from '@iconify/vue'
import { IconsType, IconType } from '@xtail/vue3'
import { IconSetPropsType } from '../XIconSet'
import { IconSetIconifyPropsType } from '../XIconSetIconify'
import { IconSetOnlineSearchIconifyPropsType } from '../XIconSetOnlineSearchIconify'
import { IconSetTypeConst, IconSetOnlineSearchTypeConst } from './consts'

export const IconSetTypeConstType_Name = 'IconSetTypeConstType'
export const IconSetOnlineSearchTypeConstType_Name = 'IconSetOnlineSearchTypeConstType'
export const IconSetType_Name = 'IconSetType'
export const IconSetsType_Name = 'IconSetsType'
export const IconPickerPropsType_Name = 'IconPickerPropsType'

export type IconSetTypeConstType = (typeof IconSetTypeConst)[keyof typeof IconSetTypeConst]

export type IconSetOnlineSearchTypeConstType =
  (typeof IconSetOnlineSearchTypeConst)[keyof typeof IconSetOnlineSearchTypeConst]

export type IconSetType = {
  type: IconSetTypeConstType
  name: string
  icons: IconifyJSON | string | IconsType
}

export type IconSetsType = IconSetType[]

export type IconPickerPropsType = {
  iconSets?: IconSetsType
  value?: IconType
  'onUpdate:value'?: (value: IconType) => void
  onlineSearch?: IconSetOnlineSearchTypeConstType
  onlineSearchTabPaneProps?: Partial<TabPaneProps>
  onlineSearchIconSetProps?: IconSetOnlineSearchIconifyPropsType
  iconSetProps?: IconSetPropsType
  iconSetIconifyProps?: IconSetIconifyPropsType
  tabPaneProps?: Partial<TabPaneProps>
  tabPaneClass?: string | string[]
  tabPaneStyle?: string | Partial<CSSProperties>
  tabsProps?: Partial<TabsProps>
  tabsClass?: string | string[]
  tabsStyle?: string | Partial<CSSProperties>
}
